VIVE 3DSP Native C Library  ver 1.0.0.0
Audio 3DSP (3D Sound Perception) Native C Library
Related Functions
vive_3dsp_audiosource Struct Reference

The vive_3dsp_audiosource structure represents the 3D audio source model. More...

#include <vive_3dsp_api/audio_source.h>

Related Functions

(Note that these are not member functions.)

vive_3dsp_audiosource * vive_3dsp_source_create_object (vive_3dsp_context *api, VIVE_3DSP_CHANNELTYPE type, int sampleRate)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_destroy_object (vive_3dsp_context *api, vive_3dsp_audiosource *src)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_set_gain (vive_3dsp_context *api, vive_3dsp_audiosource *src, float gain)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_bypassSmallSignal_enable (vive_3dsp_context *api, vive_3dsp_audiosource *src, bool enable)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_set_bypassSmallSignalValueDB (vive_3dsp_context *api, vive_3dsp_audiosource *src, float gain)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_muteFarDistantSource_enable (vive_3dsp_context *api, vive_3dsp_audiosource *src, bool enable)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_set_muteFarDistantSourceRadius (vive_3dsp_context *api, vive_3dsp_audiosource *src, float radius)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_set_position (vive_3dsp_context *api, vive_3dsp_audiosource *src, VIVE_3DSP_Vector3 pos)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_enable (vive_3dsp_context *api, vive_3dsp_audiosource *src, bool enable)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_spatializer_enable (vive_3dsp_context *api, vive_3dsp_audiosource *src, bool enable)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_reverb_enable (vive_3dsp_context *api, vive_3dsp_audiosource *src, bool enable)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_occlusion_enable (vive_3dsp_context *api, vive_3dsp_audiosource *src, bool enable)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_graphic_eq_enable (vive_3dsp_context *api, vive_3dsp_audiosource *src, bool enable)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_graphic_eq_set_gain (vive_3dsp_context *api, vive_3dsp_audiosource *src, float *pGainArray)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_graphic_eq_set_channel_num (vive_3dsp_context *api, vive_3dsp_audiosource *src, size_t num)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_parametric_eq_enable (vive_3dsp_context *api, vive_3dsp_audiosource *src, bool enable)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_parametric_eq_set_frequency (vive_3dsp_context *api, vive_3dsp_audiosource *src, float *pFreqArray)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_parametric_eq_set_gain (vive_3dsp_context *api, vive_3dsp_audiosource *src, float *pGainArray)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_parametric_eq_set_Q (vive_3dsp_context *api, vive_3dsp_audiosource *src, float *pQArray)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_parametric_eq_set_channel_num (vive_3dsp_context *api, vive_3dsp_audiosource *src, size_t num)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_quasi_doppler_enable (vive_3dsp_context *api, vive_3dsp_audiosource *src, bool enable)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_process (vive_3dsp_context *api, vive_3dsp_audiosource *src, float *in_buffer, float *out_buffer, int sampleLength)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_drc_enable (vive_3dsp_context *api, vive_3dsp_audiosource *src, bool enable)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_reset (vive_3dsp_context *api, vive_3dsp_audiosource *src)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_set_input_channel (vive_3dsp_context *api, vive_3dsp_audiosource *src, VIVE_3DSP_CHANNELTYPE type)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_set_min_volume (vive_3dsp_context *api, vive_3dsp_audiosource *src, float dB)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_set_min_distance (vive_3dsp_context *api, vive_3dsp_audiosource *src, float distance)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_set_max_distance (vive_3dsp_context *api, vive_3dsp_audiosource *src, float distance)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_setDistanceMode (vive_3dsp_context *api, vive_3dsp_audiosource *src, VIVE_3DSP_DISTANCE_MODE mode)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_setReverbMode (vive_3dsp_context *api, vive_3dsp_audiosource *src, VIVE_3DSP_REVERB_MODEL mode)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_setBinauralReverbEngine (vive_3dsp_context *api, vive_3dsp_audiosource *src, VIVE_3DSP_BINAURAL_REVERB_ENGINE mode)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_set_doppler_order (vive_3dsp_context *api, vive_3dsp_audiosource *src, int order)
 
VIVE_3DSP_API_STATUS vive_3dsp_source_export_process (vive_3dsp_context *api, vive_3dsp_audiosource *src, float *in_buffer, float *out_buffer, int sampleLength)
 

Detailed Description

The vive_3dsp_audiosource structure represents the 3D audio source model.

Examples:
Example.cpp.

Friends And Related Function Documentation

◆ vive_3dsp_source_bypassSmallSignal_enable()

VIVE_3DSP_API_STATUS vive_3dsp_source_bypassSmallSignal_enable ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
bool  enable 
)
related

Enable or disable bypass small signal effect

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
enableSet true to enable the effect
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_create_object()

vive_3dsp_audiosource * vive_3dsp_source_create_object ( vive_3dsp_context *  api,
VIVE_3DSP_CHANNELTYPE  type,
int  sampleRate 
)
related

Create a audio source object. This function must be called to get a source object before calling any other functions that can manipulate audio source property. Default output channel type is stereo.

Parameters
apiThe audio engine object.
typeInput channel type. CHANNELTYPE_MONO for mono and CHANNELTYPE_STEREO for stereo.
sampleRateSample frequency of the audio source in Hz.
Returns
Source object.

◆ vive_3dsp_source_destroy_object()

VIVE_3DSP_API_STATUS vive_3dsp_source_destroy_object ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src 
)
related

Destroy the specific audio source object.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_drc_enable()

VIVE_3DSP_API_STATUS vive_3dsp_source_drc_enable ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
bool  enable 
)
related

Turn on/off DRC (dynamic range control) module of a specific audio source. Turn on it to prevent audio clipping of the output buffer.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
enableSet true to enable the module. Otherwise, set false.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_enable()

VIVE_3DSP_API_STATUS vive_3dsp_source_enable ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
bool  enable 
)
related

Enable or disable overall effects of the specific audio source object.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
enableSet true to enable the effect. Otherwise, set false.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_export_process()

VIVE_3DSP_API_STATUS vive_3dsp_source_export_process ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
float *  in_buffer,
float *  out_buffer,
int  sampleLength 
)
related

This proces function is specified for applying some audio effects except for 3D sound effects on the audio source. For now, graphic EQ and parametric EQ are applied.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
in_bufferInput audio buffer. It can be either mono or stereo and will be automatically downmixed to mono.
out_bufferOutput audio buffer. It will be represented as stereo.
sampleLengthLength of process samples.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_graphic_eq_enable()

VIVE_3DSP_API_STATUS vive_3dsp_source_graphic_eq_enable ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
bool  enable 
)
related

Enable or disable graphic equalizer effect of the specific audio source object.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
enableSet true to enable the effect. Otherwise, set false.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_graphic_eq_set_channel_num()

VIVE_3DSP_API_STATUS vive_3dsp_source_graphic_eq_set_channel_num ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
size_t  num 
)
related

Set channel number of the graphic equalizer effect on audio source.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
numChannel number.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_graphic_eq_set_gain()

VIVE_3DSP_API_STATUS vive_3dsp_source_graphic_eq_set_gain ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
float *  pGainArray 
)
related

Set the gain of each band of graphic equalizer effect on audio source.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
pGainArrayThe array of gain of EQ bands in float.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_muteFarDistantSource_enable()

VIVE_3DSP_API_STATUS vive_3dsp_source_muteFarDistantSource_enable ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
bool  enable 
)
related

Enable or disable mute far distant source effect

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
enableSet true to enable the effect
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_occlusion_enable()

VIVE_3DSP_API_STATUS vive_3dsp_source_occlusion_enable ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
bool  enable 
)
related

Enable or disable occlusion effect of the specific audio source object.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
enableSet true to enable the effect. Otherwise, set false.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_parametric_eq_enable()

VIVE_3DSP_API_STATUS vive_3dsp_source_parametric_eq_enable ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
bool  enable 
)
related

Enable or disable parametric equalizer effect of the specific audio source object.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
enableSet true to enable the effect. Otherwise, set false.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_parametric_eq_set_channel_num()

VIVE_3DSP_API_STATUS vive_3dsp_source_parametric_eq_set_channel_num ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
size_t  num 
)
related

Set channel number of the parametric equalizer effect on audio source.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
numChannel number.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_parametric_eq_set_frequency()

VIVE_3DSP_API_STATUS vive_3dsp_source_parametric_eq_set_frequency ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
float *  pFreqArray 
)
related

Set the center frequency of each band of parametric equalizer effect on audio source.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
pFreqArrayThe array of center frequencies of EQ bands in float. Its size is 7.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_parametric_eq_set_gain()

VIVE_3DSP_API_STATUS vive_3dsp_source_parametric_eq_set_gain ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
float *  pGainArray 
)
related

Set the gain of each band of parametric equalizer effect on audio source.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
pGainArrayThe array of gains of EQ bands in float. It size is 7;
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_parametric_eq_set_Q()

VIVE_3DSP_API_STATUS vive_3dsp_source_parametric_eq_set_Q ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
float *  pQArray 
)
related

Set the Q value of each band of parametric equalizer effect on audio source.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
pQArrayThe array of gains of EQ bands in float. It size should be 5 since first and last band don't use Q value.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_process()

VIVE_3DSP_API_STATUS vive_3dsp_source_process ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
float *  in_buffer,
float *  out_buffer,
int  sampleLength 
)
related

Apply 3D sound effect of the specific audio source object to a buffer of audio data. If the input audio buffer contains more than one channel, it will automatically be downmixed to mono.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
in_bufferInput audio buffer. It can be either mono or stereo and will be automatically downmixed to mono.
out_bufferOutput audio buffer. It will be represented as stereo.
sampleLengthLength of process samples.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_quasi_doppler_enable()

VIVE_3DSP_API_STATUS vive_3dsp_source_quasi_doppler_enable ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
bool  enable 
)
related

Enable or disable quasi doppler effect of the specific audio source object.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
enableSet true to enable the effect. Otherwise, set false.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_reset()

VIVE_3DSP_API_STATUS vive_3dsp_source_reset ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src 
)
related

Reset all the effects on a specific audio source.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_reverb_enable()

VIVE_3DSP_API_STATUS vive_3dsp_source_reverb_enable ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
bool  enable 
)
related

Enable or disable revereration effect of the specific audio source object.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
enableSet true to enable the effect. Otherwise, set false.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_set_bypassSmallSignalValueDB()

VIVE_3DSP_API_STATUS vive_3dsp_source_set_bypassSmallSignalValueDB ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
float  gain 
)
related

Set threshold gain of the bypass small signal effect of specific audio source object.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
gainThreshold gain. It should be in dB scale.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_set_doppler_order()

VIVE_3DSP_API_STATUS vive_3dsp_source_set_doppler_order ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
int  order 
)
related

Set doppler order of the audio source.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
orderDoppler order.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_set_gain()

VIVE_3DSP_API_STATUS vive_3dsp_source_set_gain ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
float  gain 
)
related

Set output gain of the specific audio source object.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
gainOutput gain. It should be nonnegative and in linear scale.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_set_input_channel()

VIVE_3DSP_API_STATUS vive_3dsp_source_set_input_channel ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
VIVE_3DSP_CHANNELTYPE  type 
)
related

Set the channel type of the input signal for a specific audio source.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
typeCHANNELTYPE_MONO for mono and CHANNELTYPE_STEREO for stereo.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_set_max_distance()

VIVE_3DSP_API_STATUS vive_3dsp_source_set_max_distance ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
float  distance 
)
related

Set the maximum effective distance of the output signal for a specific audio source. It works in linear decay mode.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
distanceThe distance from listener to source. It should be positive or zero.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_set_min_distance()

VIVE_3DSP_API_STATUS vive_3dsp_source_set_min_distance ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
float  distance 
)
related

Set the minimum effective distance of the output signal for a specific audio source. It works in linear decay mode.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
distanceThe distance from listener to source. It should be positive or zero.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_set_min_volume()

VIVE_3DSP_API_STATUS vive_3dsp_source_set_min_volume ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
float  dB 
)
related

Set the minimum volume of the output signal for a specific audio source.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
dBThe minimum volume in dB. It should be non-positive.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_set_muteFarDistantSourceRadius()

VIVE_3DSP_API_STATUS vive_3dsp_source_set_muteFarDistantSourceRadius ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
float  radius 
)
related

Set the radius of the mute far distant source effect of specific audio source object.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
radiusThreshold gain. It should be in dB scale.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_set_position()

VIVE_3DSP_API_STATUS vive_3dsp_source_set_position ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
VIVE_3DSP_Vector3  pos 
)
related

Set the position of the specific audio source object.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
posThe 3D position of the audio source object.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_setBinauralReverbEngine()

VIVE_3DSP_API_STATUS vive_3dsp_source_setBinauralReverbEngine ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
VIVE_3DSP_BINAURAL_REVERB_ENGINE  mode 
)
related

Set binaural reverb engine of the audio source.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
modeBinaural Reverb engine.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_setDistanceMode()

VIVE_3DSP_API_STATUS vive_3dsp_source_setDistanceMode ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
VIVE_3DSP_DISTANCE_MODE  mode 
)
related

Set distance mode of the audio source.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
modeDistance mode.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_setReverbMode()

VIVE_3DSP_API_STATUS vive_3dsp_source_setReverbMode ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
VIVE_3DSP_REVERB_MODEL  mode 
)
related

Set reverb mode of the audio source.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
modeReverb mode.
Returns
Status code indicating whether or not the operation succeeded.

◆ vive_3dsp_source_spatializer_enable()

VIVE_3DSP_API_STATUS vive_3dsp_source_spatializer_enable ( vive_3dsp_context *  api,
vive_3dsp_audiosource *  src,
bool  enable 
)
related

Enable or disable 3D sound effect of the specific audio source object.

Parameters
apiThe audio engine object.
srcThe audio source object created by vive_3dsp_source_create_object.
enableSet true to enable the effect. Otherwise, set false.
Returns
Status code indicating whether or not the operation succeeded.

The documentation for this struct was generated from the following file: